<!-- saved from url=(0014)about:internet -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>MecGridCellBorder.mxml</title>
<link rel="stylesheet" type="text/css" href="../SourceStyles.css"/>
</head>

<body><pre><span class="MXMLProcessing_Instruction">&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;</span>
<span class="MXMLComponent_Tag">&lt;mx:Application</span><span class="MXMLDefault_Text"> xmlns:mx=&quot;</span><span class="MXMLString">http://www.adobe.com/2006/mxml</span><span class="MXMLDefault_Text">&quot; layout=&quot;</span><span class="MXMLString">absolute</span><span class="MXMLDefault_Text">&quot; xmlns:ns1=&quot;</span><span class="MXMLString">com.mechan.MecGrid.*</span><span class="MXMLDefault_Text">&quot; backgroundColor=&quot;</span><span class="MXMLString">#ffffff</span><span class="MXMLDefault_Text">&quot; creationComplete=&quot;</span><span class="ActionScriptDefault_Text">initApp</span><span class="ActionScriptBracket/Brace">()</span><span class="MXMLDefault_Text">&quot; viewSourceURL=&quot;</span><span class="MXMLString">srcview/index.html</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
<span class="MXMLSpecial_Tag">&lt;mx:Script&gt;</span>
    <span class="ActionScriptOperator">&lt;!</span><span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptDefault_Text">CDATA</span><span class="ActionScriptBracket/Brace">[</span>
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">collections</span>.<span class="ActionScriptDefault_Text">ArrayCollection</span>; 
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">mx</span>.<span class="ActionScriptDefault_Text">controls</span>.<span class="ActionScriptDefault_Text">Alert</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">mechan</span>.<span class="ActionScriptDefault_Text">MecGrid</span>.<span class="ActionScriptDefault_Text">mecGridClasses</span>.<span class="ActionScriptDefault_Text">MecGridEvent</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">mechan</span>.<span class="ActionScriptDefault_Text">MecGrid</span>.<span class="ActionScriptDefault_Text">mecGridClasses</span>.<span class="ActionScriptDefault_Text">CellOp</span>;
        <span class="ActionScriptReserved">import</span> <span class="ActionScriptDefault_Text">com</span>.<span class="ActionScriptDefault_Text">mechan</span>.<span class="ActionScriptDefault_Text">MecGrid</span>.<span class="ActionScriptDefault_Text">mecGridClasses</span>.<span class="ActionScriptDefault_Text">MecGridConst</span>;
        
        <span class="ActionScriptComment">// This feature requires version 1.0.2
</span>        <span class="ActionScriptComment">// CHECK the MecGrid Version By MecGrid.VERSION static variable
</span>        
        <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptMetadata">Bindable</span><span class="ActionScriptBracket/Brace">]</span>
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">dpBorderThickness</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptBracket/Brace">[</span>1, 2, 3, 4, 5<span class="ActionScriptBracket/Brace">]</span>;
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">countrydata</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Array</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptBracket/Brace">[</span>
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Eastern Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Korea&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Ulsan&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Eastern Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Korea&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Seoul&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Eastern Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Korea&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Pusan&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Eastern Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;China&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Beijing&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Eastern Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;SubTotal&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;SubTotal&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;South-Eastern Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Malaysia&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Kualalumpur&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Western Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Turkey&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Istanbul&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Western Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Turkey&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Antalya&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Southern Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;India&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;New Delhi&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Southern Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;India&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Bangalore&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Southern Asia&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;India&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Chennai&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Europe&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;France&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Paris&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Europe&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;France&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;La Tronche&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Europe&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;France&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Lyon&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Europe&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;France&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Saintes&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Europe&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;England&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;London&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Europe&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;England&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Birmingham&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Europe&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Germany&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Birlin&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Europe&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Germany&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Cologne&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Europe&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Germany&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Mainz&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Europe&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Sweden&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;Solna&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;America&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;USA&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;New York&apos;</span><span class="ActionScriptBracket/Brace">}</span>,
                                  <span class="ActionScriptBracket/Brace">{</span><span class="ActionScriptDefault_Text">continent</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;America&apos;</span>, <span class="ActionScriptDefault_Text">country</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;USA&apos;</span>, <span class="ActionScriptDefault_Text">city</span><span class="ActionScriptOperator">:</span><span class="ActionScriptString">&apos;California&apos;</span><span class="ActionScriptBracket/Brace">}]</span>;
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">initApp</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MecGridEvent</span>.<span class="ActionScriptDefault_Text">DRAW_COMPLETED</span>, <span class="ActionScriptDefault_Text">displayGridEvent</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MecGridEvent</span>.<span class="ActionScriptDefault_Text">SELECTION_CHANGED</span>, <span class="ActionScriptDefault_Text">displayGridEvent</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MecGridEvent</span>.<span class="ActionScriptDefault_Text">BEGIN_EDIT_CELL</span>, <span class="ActionScriptDefault_Text">beginEditCellHandler</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MecGridEvent</span>.<span class="ActionScriptDefault_Text">CHECK_STATE_CHANGED</span>, <span class="ActionScriptDefault_Text">beginEditCellHandler</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MecGridEvent</span>.<span class="ActionScriptDefault_Text">END_EDIT_CELL</span>, <span class="ActionScriptDefault_Text">displayGridEvent</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MecGridEvent</span>.<span class="ActionScriptDefault_Text">TREE_OPENED</span>, <span class="ActionScriptDefault_Text">displayGridEvent</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MecGridEvent</span>.<span class="ActionScriptDefault_Text">TREE_COLLAPSED</span>, <span class="ActionScriptDefault_Text">displayGridEvent</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span> 
        
<span class="ActionScriptComment">// DOUBLE CLICK CELL EDITING
</span>        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">beginEditCellHandler</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MecGridEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">displayGridEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">edit_colIndex</span> <span class="ActionScriptOperator">==</span> 5<span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">EditCell</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>, <span class="ActionScriptDefault_Text">CellOp</span>.<span class="ActionScriptDefault_Text">EDIT_TEXT</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            <span class="ActionScriptReserved">else</span> <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>.<span class="ActionScriptDefault_Text">edit_colIndex</span> <span class="ActionScriptOperator">==</span> 6<span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">EditCell</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span>, <span class="ActionScriptDefault_Text">CellOp</span>.<span class="ActionScriptDefault_Text">EDIT_COMBOBOX</span>, <span class="ActionScriptBracket/Brace">[</span><span class="ActionScriptString">&quot;combo selection 1&quot;</span>, <span class="ActionScriptString">&quot;combo selection 2&quot;</span>, <span class="ActionScriptString">&quot;combo selection 3&quot;</span><span class="ActionScriptBracket/Brace">])</span>;
            <span class="ActionScriptBracket/Brace">}</span>
        <span class="ActionScriptBracket/Brace">}</span>

<span class="ActionScriptComment">// LOAD SAMPLE XML DATA FOR TREE    
</span>        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">loadDataProvider</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">redraw</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">SelectionMode</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">CellOp</span>.<span class="ActionScriptDefault_Text">SELECTIONMODE_CELL</span> <span class="ActionScriptOperator">|</span> <span class="ActionScriptDefault_Text">CellOp</span>.<span class="ActionScriptDefault_Text">SELECT_MULTI</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Rows</span>.<span class="ActionScriptDefault_Text">count</span> <span class="ActionScriptOperator">=</span> 0;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Cols</span>.<span class="ActionScriptDefault_Text">count</span> <span class="ActionScriptOperator">=</span> 5;
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">spreadSheetStyle</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">merge_option</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">MecGridConst</span>.<span class="ActionScriptDefault_Text">MERGE_PREV</span>;
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">AddRow</span><span class="ActionScriptBracket/Brace">(</span>0, <span class="ActionScriptString">&quot;CONTINENT;COUNTRY;CITY;VALUE1;VALUE2&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Rows</span>.<span class="ActionScriptDefault_Text">fixed</span> <span class="ActionScriptOperator">=</span> 1;
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Cols</span>.<span class="ActionScriptDefault_Text">item</span><span class="ActionScriptBracket/Brace">(</span>0<span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">dataField</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;continent&quot;</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Cols</span>.<span class="ActionScriptDefault_Text">item</span><span class="ActionScriptBracket/Brace">(</span>1<span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">dataField</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;country&quot;</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Cols</span>.<span class="ActionScriptDefault_Text">item</span><span class="ActionScriptBracket/Brace">(</span>2<span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">dataField</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;city&quot;</span>;
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Cols</span>.<span class="ActionScriptDefault_Text">item</span><span class="ActionScriptBracket/Brace">(</span>0<span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">merge</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Cols</span>.<span class="ActionScriptDefault_Text">item</span><span class="ActionScriptBracket/Brace">(</span>1<span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">merge</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Cols</span>.<span class="ActionScriptDefault_Text">item</span><span class="ActionScriptBracket/Brace">(</span>2<span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">merge</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Cols</span>.<span class="ActionScriptDefault_Text">item</span><span class="ActionScriptBracket/Brace">(</span>3<span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">datatype</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">CellOp</span>.<span class="ActionScriptDefault_Text">STATUSBAR</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Cols</span>.<span class="ActionScriptDefault_Text">item</span><span class="ActionScriptBracket/Brace">(</span>4<span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">datatype</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">CellOp</span>.<span class="ActionScriptDefault_Text">STATUSBAR</span>;
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">addEventListener</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">MecGridEvent</span>.<span class="ActionScriptDefault_Text">DATAPROVIDER_UPDATE_FINISHED</span>, <span class="ActionScriptDefault_Text">refreshRandomValues</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">treeGridData</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">false</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">dataProvider</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">countrydata</span>;
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">redraw</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">refreshRandomValues</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MecGridEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span>;
            
            <span class="ActionScriptComment">// set background and fore color of text
</span>            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_BACKCOLOR</span>, 1, 0, 0<span class="ActionScriptDefault_Text">x333333</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_BACKCOLOR</span>, 1, 1, 0<span class="ActionScriptDefault_Text">x333333</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_BACKCOLOR</span>, 1, 2, 0<span class="ActionScriptDefault_Text">x333333</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_FORECOLOR</span>, 1, 0, 0<span class="ActionScriptDefault_Text">xffffff</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_FORECOLOR</span>, 1, 1, 0<span class="ActionScriptDefault_Text">xffffff</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_FORECOLOR</span>, 1, 2, 0<span class="ActionScriptDefault_Text">xffffff</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_BACKCOLOR</span>, 9, 0, 0<span class="ActionScriptDefault_Text">x000066</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_BACKCOLOR</span>, 9, 1, 0<span class="ActionScriptDefault_Text">x000066</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_BACKCOLOR</span>, 11, 2, 0<span class="ActionScriptDefault_Text">x000066</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_FORECOLOR</span>, 9, 0, 0<span class="ActionScriptDefault_Text">xffffff</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_FORECOLOR</span>, 9, 1, 0<span class="ActionScriptDefault_Text">xffffff</span><span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">STYLE_FORECOLOR</span>, 11, 2, 0<span class="ActionScriptDefault_Text">xffffff</span><span class="ActionScriptBracket/Brace">)</span>;
            
            <span class="ActionScriptReserved">for</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">=</span><span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Rows</span>.<span class="ActionScriptDefault_Text">fixed</span>; <span class="ActionScriptDefault_Text">i</span> <span class="ActionScriptOperator">&lt;</span> <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Rows</span>.<span class="ActionScriptDefault_Text">count</span>; <span class="ActionScriptDefault_Text">i</span><span class="ActionScriptOperator">++</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">TEXT</span>, <span class="ActionScriptDefault_Text">i</span>, 3, <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">random</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">*</span> 100<span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">set_cell</span><span class="ActionScriptBracket/Brace">(C</span><span class="ActionScriptDefault_Text">ellOp</span>.<span class="ActionScriptDefault_Text">TEXT</span>, <span class="ActionScriptDefault_Text">i</span>, 4, <span class="ActionScriptDefault_Text">Math</span>.<span class="ActionScriptDefault_Text">random</span><span class="ActionScriptBracket/Brace">()</span> <span class="ActionScriptOperator">*</span> 100<span class="ActionScriptBracket/Brace">)</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">Rows</span>.<span class="ActionScriptDefault_Text">item</span><span class="ActionScriptBracket/Brace">(</span>5<span class="ActionScriptBracket/Brace">)</span>.<span class="ActionScriptDefault_Text">merge</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">redraw</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptBracket/Brace">}</span>

<span class="ActionScriptComment">// USER ACTION
</span>        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">changeSelectionMode</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">Event</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">switch</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">mgridSelectionMode</span>.<span class="ActionScriptDefault_Text">selectedValue</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">case</span> <span class="ActionScriptString">&quot;Row&quot;</span><span class="ActionScriptOperator">:</span>
                <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">SelectionMode</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">CellOp</span>.<span class="ActionScriptDefault_Text">SELECTIONMODE_ROW</span> <span class="ActionScriptOperator">|</span> <span class="ActionScriptDefault_Text">CellOp</span>.<span class="ActionScriptDefault_Text">SELECT_SINGLE</span>;
                <span class="ActionScriptReserved">break</span>;
            <span class="ActionScriptReserved">case</span> <span class="ActionScriptString">&quot;Column&quot;</span><span class="ActionScriptOperator">:</span>
                <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">SelectionMode</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">CellOp</span>.<span class="ActionScriptDefault_Text">SELECTIONMODE_CELL</span> <span class="ActionScriptOperator">|</span> <span class="ActionScriptDefault_Text">CellOp</span>.<span class="ActionScriptDefault_Text">SELECT_MULTI</span>;
                <span class="ActionScriptReserved">break</span>;
            <span class="ActionScriptBracket/Brace">}</span> 
        <span class="ActionScriptBracket/Brace">}</span>
        
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">changeSpreadSheetStyle</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">spreadSheetStyle</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">btnSpreadSheetStyle</span>.<span class="ActionScriptDefault_Text">selected</span>;
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">redraw</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">true</span>;
        <span class="ActionScriptBracket/Brace">}</span>
<span class="ActionScriptComment">// MISC
</span>        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">displayGridEvent</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">e</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">MecGridEvent</span><span class="ActionScriptBracket/Brace">)</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">ndisp</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;&quot;</span>;
            
            <span class="ActionScriptDefault_Text">ndisp</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;&gt;&gt; EVENT &quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">e</span>.<span class="ActionScriptDefault_Text">type</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&quot;\n&quot;</span>;
            
            <span class="ActionScriptReserved">switch</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">e</span>.<span class="ActionScriptDefault_Text">type</span><span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptReserved">case</span> <span class="ActionScriptDefault_Text">MecGridEvent</span>.<span class="ActionScriptDefault_Text">DRAW_COMPLETED</span><span class="ActionScriptOperator">:</span>
                <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">strAreaInfo</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">String</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptString">&quot;render {left:&quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">leftColumn</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&quot;,top:&quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">topRow</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&quot;,right:&quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">rightColumn</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&quot;,bottom:&quot;</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">bottomRow</span> <span class="ActionScriptOperator">+</span> <span class="ActionScriptString">&quot;}&quot;</span>
                <span class="ActionScriptDefault_Text">labelVisibleArea</span>.<span class="ActionScriptDefault_Text">text</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">strAreaInfo</span>;
                <span class="ActionScriptReserved">break</span>;
            <span class="ActionScriptReserved">case</span> <span class="ActionScriptDefault_Text">MecGridEvent</span>.<span class="ActionScriptDefault_Text">SELECTION_CHANGED</span><span class="ActionScriptOperator">:</span>
                <span class="ActionScriptReserved">break</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            
            <span class="ActionScriptComment">// txtEventInfo.text = ndisp + txtEventInfo.text;
</span>        <span class="ActionScriptBracket/Brace">}</span>
        
        <span class="ActionScriptReserved">private</span> <span class="ActionScriptfunction">function</span> <span class="ActionScriptDefault_Text">changeColorLayout</span><span class="ActionScriptBracket/Brace">()</span><span class="ActionScriptOperator">:</span><span class="ActionScriptReserved">void</span>
        <span class="ActionScriptBracket/Brace">{</span>
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">bgcolor</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">uint</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">uiBackColor</span>.<span class="ActionScriptDefault_Text">selectedColor</span> <span class="ActionScriptReserved">as</span> <span class="ActionScriptDefault_Text">uint</span>;
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">outerThickness</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">uiOuterBorderThickness</span>.<span class="ActionScriptDefault_Text">selectedItem</span> <span class="ActionScriptReserved">as</span> <span class="ActionScriptDefault_Text">int</span>;
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">innerThickness</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">int</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptReserved">this</span>.<span class="ActionScriptDefault_Text">uiInnerBorderThickness</span>.<span class="ActionScriptDefault_Text">selectedItem</span> <span class="ActionScriptReserved">as</span> <span class="ActionScriptDefault_Text">int</span>;
            
            <span class="ActionScriptvar">var</span> <span class="ActionScriptDefault_Text">cr</span><span class="ActionScriptOperator">:</span><span class="ActionScriptDefault_Text">ArrayCollection</span> <span class="ActionScriptOperator">=</span> <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">SelectedItems</span>;
            
            <span class="ActionScriptReserved">if</span> <span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">cr</span> <span class="ActionScriptOperator">==</span> <span class="ActionScriptReserved">null</span> <span class="ActionScriptOperator">||</span> <span class="ActionScriptDefault_Text">cr</span>.<span class="ActionScriptDefault_Text">length</span> <span class="ActionScriptOperator">==</span> 0<span class="ActionScriptBracket/Brace">)</span>
            <span class="ActionScriptBracket/Brace">{</span>
                <span class="ActionScriptDefault_Text">Alert</span>.<span class="ActionScriptDefault_Text">show</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptString">&quot;Please select region by dragging to draw&quot;</span><span class="ActionScriptBracket/Brace">)</span>;
                <span class="ActionScriptReserved">return</span>;
            <span class="ActionScriptBracket/Brace">}</span>
            
            <span class="ActionScriptDefault_Text">mgrid</span>.<span class="ActionScriptDefault_Text">drawRegion</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">cr</span>, <span class="ActionScriptDefault_Text">bgcolor</span>, <span class="ActionScriptDefault_Text">uiForeColor</span>.<span class="ActionScriptDefault_Text">selectedColor</span>, <span class="ActionScriptDefault_Text">innerThickness</span>, <span class="ActionScriptDefault_Text">outerThickness</span>, <span class="ActionScriptDefault_Text">uiInsideBorderColor</span>.<span class="ActionScriptDefault_Text">selectedColor</span>, <span class="ActionScriptDefault_Text">uiOutsideBorderColor</span>.<span class="ActionScriptDefault_Text">selectedColor</span><span class="ActionScriptBracket/Brace">)</span>;
        <span class="ActionScriptBracket/Brace">}</span>
    <span class="ActionScriptBracket/Brace">]]</span><span class="ActionScriptOperator">&gt;</span>
<span class="MXMLSpecial_Tag">&lt;/mx:Script&gt;</span> 
    <span class="MXMLComponent_Tag">&lt;ns1:MecGrid</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">mgrid</span><span class="MXMLDefault_Text">&quot; right=&quot;</span><span class="MXMLString">218</span><span class="MXMLDefault_Text">&quot; left=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; top=&quot;</span><span class="MXMLString">75</span><span class="MXMLDefault_Text">&quot; bottom=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:TextInput</span><span class="MXMLDefault_Text"> width=&quot;</span><span class="MXMLString">200</span><span class="MXMLDefault_Text">&quot; fontWeight=&quot;</span><span class="MXMLString">bold</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">Control Panel</span><span class="MXMLDefault_Text">&quot; textDecoration=&quot;</span><span class="MXMLString">underline</span><span class="MXMLDefault_Text">&quot; fontStyle=&quot;</span><span class="MXMLString">italic</span><span class="MXMLDefault_Text">&quot; borderStyle=&quot;</span><span class="MXMLString">inset</span><span class="MXMLDefault_Text">&quot; cornerRadius=&quot;</span><span class="MXMLString">2</span><span class="MXMLDefault_Text">&quot; borderColor=&quot;</span><span class="MXMLString">#D1DDE6</span><span class="MXMLDefault_Text">&quot; backgroundColor=&quot;</span><span class="MXMLString">#F6DBDB</span><span class="MXMLDefault_Text">&quot; right=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; top=&quot;</span><span class="MXMLString">75</span><span class="MXMLDefault_Text">&quot; height=&quot;</span><span class="MXMLString">22</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:RadioButtonGroup</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">mgridSelectionMode</span><span class="MXMLDefault_Text">&quot; change=&quot;</span><span class="ActionScriptDefault_Text">changeSelectionMode</span><span class="ActionScriptBracket/Brace">(</span><span class="ActionScriptDefault_Text">event</span><span class="ActionScriptBracket/Brace">)</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:RadioButton</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">45</span><span class="MXMLDefault_Text">&quot; label=&quot;</span><span class="MXMLString">SelectRow</span><span class="MXMLDefault_Text">&quot; groupName=&quot;</span><span class="MXMLString">mgridSelectionMode</span><span class="MXMLDefault_Text">&quot; value=&quot;</span><span class="MXMLString">Row</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:RadioButton</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">90</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">45</span><span class="MXMLDefault_Text">&quot; label=&quot;</span><span class="MXMLString">SelectCell</span><span class="MXMLDefault_Text">&quot; groupName=&quot;</span><span class="MXMLString">mgridSelectionMode</span><span class="MXMLDefault_Text">&quot; selected=&quot;</span><span class="MXMLString">true</span><span class="MXMLDefault_Text">&quot; value=&quot;</span><span class="MXMLString">Column</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:Button</span><span class="MXMLDefault_Text"> label=&quot;</span><span class="MXMLString">Load SampleData</span><span class="MXMLDefault_Text">&quot; top=&quot;</span><span class="MXMLString">15</span><span class="MXMLDefault_Text">&quot; click=&quot;</span><span class="ActionScriptDefault_Text">loadDataProvider</span><span class="ActionScriptBracket/Brace">()</span><span class="MXMLDefault_Text">&quot; x=&quot;</span><span class="MXMLString">16</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:CheckBox</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">btnSpreadSheetStyle</span><span class="MXMLDefault_Text">&quot; x=&quot;</span><span class="MXMLString">207</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">45</span><span class="MXMLDefault_Text">&quot; label=&quot;</span><span class="MXMLString">SpreadSheetStyle</span><span class="MXMLDefault_Text">&quot; click=&quot;</span><span class="ActionScriptDefault_Text">changeSpreadSheetStyle</span><span class="ActionScriptBracket/Brace">()</span><span class="MXMLDefault_Text">&quot; selected=&quot;</span><span class="MXMLString">true</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">364</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">47</span><span class="MXMLDefault_Text">&quot; id=&quot;</span><span class="MXMLString">labelVisibleArea</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;mx:Canvas</span><span class="MXMLDefault_Text"> width=&quot;</span><span class="MXMLString">200</span><span class="MXMLDefault_Text">&quot; right=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; bottom=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; top=&quot;</span><span class="MXMLString">105</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">Background Color</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:ColorPicker</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">uiBackColor</span><span class="MXMLDefault_Text">&quot; x=&quot;</span><span class="MXMLString">121</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; selectedColor=&quot;</span><span class="MXMLString">#95FAAD</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">44</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">Foreground Color</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:ColorPicker</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">121</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">40</span><span class="MXMLDefault_Text">&quot; id=&quot;</span><span class="MXMLString">uiForeColor</span><span class="MXMLDefault_Text">&quot; selectedColor=&quot;</span><span class="MXMLString">#FE0202</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">77</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">- Outline border</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:ComboBox</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">uiOuterBorderThickness</span><span class="MXMLDefault_Text">&quot; x=&quot;</span><span class="MXMLString">103</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">92</span><span class="MXMLDefault_Text">&quot; width=&quot;</span><span class="MXMLString">53</span><span class="MXMLDefault_Text">&quot; dataProvider=&quot;</span><span class="MXMLString">{</span><span class="ActionScriptDefault_Text">dpBorderThickness</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span><span class="MXMLComponent_Tag">&lt;/mx:ComboBox&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:ColorPicker</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">103</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">116</span><span class="MXMLDefault_Text">&quot; id=&quot;</span><span class="MXMLString">uiOutsideBorderColor</span><span class="MXMLDefault_Text">&quot; selectedColor=&quot;</span><span class="MXMLString">#A6A6FE</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">150</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">- Inside border</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:ComboBox</span><span class="MXMLDefault_Text"> id=&quot;</span><span class="MXMLString">uiInnerBorderThickness</span><span class="MXMLDefault_Text">&quot; x=&quot;</span><span class="MXMLString">103</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">174</span><span class="MXMLDefault_Text">&quot; width=&quot;</span><span class="MXMLString">53</span><span class="MXMLDefault_Text">&quot; dataProvider=&quot;</span><span class="MXMLString">{</span><span class="ActionScriptDefault_Text">dpBorderThickness</span><span class="MXMLString">}</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">&gt;</span><span class="MXMLComponent_Tag">&lt;/mx:ComboBox&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:ColorPicker</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">103</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">200</span><span class="MXMLDefault_Text">&quot; id=&quot;</span><span class="MXMLString">uiInsideBorderColor</span><span class="MXMLDefault_Text">&quot; selectedColor=&quot;</span><span class="MXMLString">#A6A6FE</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Button</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">10</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">248</span><span class="MXMLDefault_Text">&quot; label=&quot;</span><span class="MXMLString">Apply</span><span class="MXMLDefault_Text">&quot; click=&quot;</span><span class="ActionScriptDefault_Text">changeColorLayout</span><span class="ActionScriptBracket/Brace">()</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">42</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">94</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">Thickness</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">67</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">120</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">Color</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">42</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">176</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">Thickness</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
        <span class="MXMLComponent_Tag">&lt;mx:Label</span><span class="MXMLDefault_Text"> x=&quot;</span><span class="MXMLString">67</span><span class="MXMLDefault_Text">&quot; y=&quot;</span><span class="MXMLString">202</span><span class="MXMLDefault_Text">&quot; text=&quot;</span><span class="MXMLString">Color</span><span class="MXMLDefault_Text">&quot;</span><span class="MXMLComponent_Tag">/&gt;</span>
    <span class="MXMLComponent_Tag">&lt;/mx:Canvas&gt;</span>
<span class="MXMLComponent_Tag">&lt;/mx:Application&gt;</span></pre></body>
</html>
